package com.aurora.app.entity;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.aurora.base.entity.BaseEntity;


/**
 * 收藏二手物品的故事
 * @author yongjiang.lin
 *
 */
@Entity
@Table(name="tb_collection_thing_story")
public class CollectionThingStory extends BaseEntity implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private ThingStory thingStory;
	private User user;
	
	@ManyToOne(cascade = {CascadeType.REFRESH}, optional = false, fetch = FetchType.LAZY)
	@JoinColumn(name = "f_thing_story_id")
	public ThingStory getThingStory() {
		return thingStory;
	}

	public void setThingStory(ThingStory thingStory) {
		this.thingStory = thingStory;
	}

	@ManyToOne(cascade = {CascadeType.REFRESH}, optional = false, fetch = FetchType.LAZY)
	@JoinColumn(name = "f_user_id")
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
}
